import { defineStore } from 'pinia'
export const useMusicStore = defineStore({
  id: 'music', // id必填，且需要唯一
  state: () => {
    return {
      curPlayMusicUrl: '',
      curMusicInfo: {},
      curSongList: {},
      isPlay:false,
    }
  },
  actions: {
    saveCurPlayMusicUrl(url) {
      this.curPlayMusicUrl=url
    },
    saveCurMusicInfo(info) {
      this.curMusicInfo=info
    },
    saveCurSongList(songlist) {
      this.curSongList=songlist
    },
    setIsPlay(is) {
      this.isPlay=is
    }
  },
  // 开启数据缓存
  persist: {
    enabled: true
  }
})
